/*
 * @Author: NJ_1098 xiabaoxin
 * @Date: 2025-02-12 09:48:40
 * @LastEditors: NJ_1098 xiabaoxin
 * @LastEditTime: 2025-02-14 14:29:20
 * @Description: 公共路由
 */
const Router = require("koa-router");
const router = new Router({ prefix: "/public" });
const UserMiddleware = require("../middleware/user.middleware");
const PublicController = require("../controller/public.controller");

/**
 * @author: NJ_1098 xiabaoxin
 * @description: 文件上传（身份认证）
 * @return {*}
 */
router.post("/upload", UserMiddleware.verifyToken, PublicController.upload);

/**
 * @author: NJ_1098 xiabaoxin
 * @description: 文件上传（无需身份认证）
 * @return {*}
 */
router.post("/uploadWithoutToken", PublicController.uploadWithoutToken);

router.get("/captcha", PublicController.getCaptcha);

module.exports = router;
